<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card">
    <div class="layui-card-body padding-left-40">

        <div class="layui-form-item label-required-prev">
            <span class="help-label"><b>绑定公众号</b>Bind WeChat Type</span>
            <div class="layui-textarea help-checks">
                {php} $data['wechat_type'] = $data['wechat_type'] ?? 'normal'; {/php}
                {foreach ['normal'=>'兼容模式', 'wxapp'=>'微信小程序', 'wechat'=>'微信服务号'] as $k=>$v}
                {if $k eq $data.wechat_type}
                <input checked name="wechat_type" title="{$v}" type='radio' value="{$k}">
                {else}
                <input name="wechat_type" title="{$v}" type='radio' value="{$k}">
                {/if}{/foreach}
            </div>
            <span class="help-block">请选择正确的转账通道，以决定用户 OPENID 字段，兼容模式会自动选择通道</span>
        </div>

        <label class="layui-form-item block relative">
            <span class="help-label"><b>微信商户号</b>WeChat Payment Number</span>
            <input class="layui-input" maxlength="50" name="wechat_mch_id" placeholder="请输入微信商户号MCH_ID（必填）" required value="{$data.wechat_mch_id|default=''}">
            <span class="help-block">微信商户编号，需要在微信商户平台获取，微信商户号 与 公众号APPID 匹配</span>
        </label>

        <label class="layui-form-item block relative">
            <span class="help-label"><b>微信商户密钥</b>WeChat Payment Secret Key</span>
            <input class="layui-input" maxlength="32" name="wechat_mch_key" pattern=".{32}" placeholder="请输入32位微信商户密钥（必填）" required value="{$data.wechat_mch_key|default=''}">
            <span class="help-block">微信商户密钥，需要在微信商户平台操作设置密码并获取密钥，建议定期更换密钥</span>
        </label>

        <label class="layui-form-item block relative">
            <span class="help-label"><b>微信商户密钥文件内容</b>（ 需要填写文件的全部内容 ）</span>
            <textarea class="layui-textarea" name="wechat_mch_key_text" placeholder="请输入微信商户 KEY 密钥内容" required>{$data.wechat_mch_key_text|default=''}</textarea>
            <span class="help-block">从商户平台上下载支付证书，解压并取得其中的 apiclient_key.pem 用记事本打开并复制文件内容填至此处</span>
        </label>

        <label class="layui-form-item block relative">
            <span class="help-label"><b>微信商户证书文件内容</b>（ 需要填写文件的全部内容 ）</span>
            <textarea class="layui-textarea" name="wechat_mch_cert_text" placeholder="请输入微信商户 CERT 证书内容" required>{$data.wechat_mch_cert_text|default=''}</textarea>
            <span class="help-block">从商户平台上下载支付证书，解压并取得其中的 apiclient_cert.pem 用记事本打开并复制文件内容填至此处</span>
        </label>

    </div>

    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" data-close data-confirm="确定要取消编辑吗？" type='button'>取消编辑</button>
    </div>
</form>